package cn.jetpiece.cloud.rabbit.starter.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>RabbitMq 失败消息记录表</p>
 *
 * @author <a href="mailto:blnp.yibin@qq.com">lyb</a>
 * @version 1.0
 * @since 2025/4/27 10:31
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "mq_fail_msg")
public class FailMsgEntity {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     *  消息ID
     **/
    @TableField(value = "msg_id")
    private String msgId;

    /**
     *  交换机
     **/
    @TableField(value = "exchange")
    private String exchange;

    /**
     *  路由key
     **/
    @TableField(value = "routing_key")
    private String routingKey;

    /**
     *  消息内容
     **/
    @TableField(value = "msg")
    private String msg;

    /**
     *  失败原因
     **/
    @TableField(value = "reason")
    private String reason;

    /**
     *  创建时间
     **/
    @TableField(value = "created", fill = FieldFill.INSERT)
    private LocalDateTime created;

    /**
     *  更新时间
     **/
    @TableField(value = "updated", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updated;
}
